home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / Dev / Oberon / source / amiga / Printer.mod < prev    next >
Text File  |  1995-06-29  |  22KB  |  467 lines

  1. (**************************************************************************
  2.  
  3.      $RCSfile: Printer.mod $
  4.   Description: Interface to printer.device
  5.  
  6.    Created by: fjc (Frank Copeland)
  7.     $Revision: 3.8 $
  8.       $Author: fjc $
  9.         $Date: 1995/06/04 23:13:14 $
  10.  
  11.   Includes Release 40.15
  12.  
  13.   (C) Copyright 1987-1993 Commodore-Amiga, Inc.
  14.       All Rights Reserved
  15.  
  16.   Oberon-A interface Copyright © 1994-1995, Frank Copeland.
  17.   This file is part of the Oberon-A Interface.
  18.   See Oberon-A.doc for conditions of use and distribution.
  19.  
  20. ***************************************************************************)
  21.  
  22. <* STANDARD- *>
  23.  
  24. MODULE [2] Printer;
  25.  
  26. IMPORT
  27.   SYS := SYSTEM, e := Exec, t := Timer, par := Parallel,
  28.   ser := Serial, g := Graphics, i := Intuition, s := Sets;
  29.  
  30.  
  31. (*
  32. **      $VER: printer.h 1.7 (26.7.90)
  33. **
  34. **      printer.device structure definitions
  35. *)
  36.  
  37. CONST
  38.  
  39.   rawWrite *   =   e.nonstd+0;
  40.   prtCommand * =   e.nonstd+1;
  41.   dumpRPort *  =   e.nonstd+2;
  42.   query *      =   e.nonstd+3;
  43.  
  44. (* printer command definitions *)
  45.  
  46.   aRIS *    = 0;   (* ESCc  reset                    ISO *)
  47.   aRIN *    = 1;   (* ESC#1 initialize               +++ *)
  48.   aIND *    = 2;   (* ESCD  lf                       ISO *)
  49.   aNEL *    = 3;   (* ESCE  return,lf                ISO *)
  50.   aRI *     = 4;   (* ESCM  reverse lf               ISO *)
  51.  
  52.   aSGR0 *   = 5;   (* ESC[0m normal char set         ISO *)
  53.   aSGR3 *   = 6;   (* ESC[3m italics on              ISO *)
  54.   aSGR23 *  = 7;   (* ESC[23m italics off            ISO *)
  55.   aSGR4 *   = 8;   (* ESC[4m underline on            ISO *)
  56.   aSGR24 *  = 9;   (* ESC[24m underline off          ISO *)
  57.   aSGR1 *   = 10;  (* ESC[1m boldface on             ISO *)
  58.   aSGR22 *  = 11;  (* ESC[22m boldface off           ISO *)
  59.   aSFC *    = 12;  (* SGR30-39  set foreground color ISO *)
  60.   aSBC *    = 13;  (* SGR40-49  set background color ISO *)
  61.  
  62.   aSHORP0 * = 14;  (* ESC[0w normal pitch            DEC *)
  63.   aSHORP2 * = 15;  (* ESC[2w elite on                DEC *)
  64.   aSHORP1 * = 16;  (* ESC[1w elite off       DEC *)
  65.   aSHORP4 * = 17;  (* ESC[4w condensed fine on       DEC *)
  66.   aSHORP3 * = 18;  (* ESC[3w condensed off           DEC *)
  67.   aSHORP6 * = 19;  (* ESC[6w enlarged on             DEC *)
  68.   aSHORP5 * = 20;  (* ESC[5w enlarged off            DEC *)
  69.  
  70.   aDEN6 *   = 21;  (* ESC[6"z shadow print on        DEC (sort of) *)
  71.   aDEN5 *   = 22;  (* ESC[5"z shadow print off       DEC *)
  72.   aDEN4 *   = 23;  (* ESC[4"z doublestrike on        DEC *)
  73.   aDEN3 *   = 24;  (* ESC[3"z doublestrike off       DEC *)
  74.   aDEN2 *   = 25;  (* ESC[2"z  NLQ on                DEC *)
  75.   aDEN1 *   = 26;  (* ESC[1"z  NLQ off       DEC *)
  76.  
  77.   aSUS2 *   = 27;  (* ESC[2v superscript on          +++ *)
  78.   aSUS1 *   = 28;  (* ESC[1v superscript off         +++ *)
  79.   aSUS4 *   = 29;  (* ESC[4v subscript on            +++ *)
  80.   aSUS3 *   = 30;  (* ESC[3v subscript off           +++ *)
  81.   aSUS0 *   = 31;  (* ESC[0v normalize the line      +++ *)
  82.   aPLU *    = 32;  (* ESCL  partial line up          ISO *)
  83.   aPLD *    = 33;  (* ESCK  partial line down        ISO *)
  84.  
  85.   aFNT0 *   = 34;  (* ESC(B US char set        or Typeface  0 (default) *)
  86.   aFNT1 *   = 35;  (* ESC(R French char set    or Typeface  1 *)
  87.   aFNT2 *   = 36;  (* ESC(K German char set    or Typeface  2 *)
  88.   aFNT3 *   = 37;  (* ESC(A UK char set        or Typeface  3 *)
  89.   aFNT4 *   = 38;  (* ESC(E Danish I char set  or Typeface  4 *)
  90.   aFNT5 *   = 39;  (* ESC(H Sweden char set    or Typeface  5 *)
  91.   aFNT6 *   = 40;  (* ESC(Y Italian char set   or Typeface  6 *)
  92.   aFNT7 *   = 41;  (* ESC(Z Spanish char set   or Typeface  7 *)
  93.   aFNT8 *   = 42;  (* ESC(J Japanese char set  or Typeface  8 *)
  94.   aFNT9 *   = 43;  (* ESC(6 Norweign char set  or Typeface  9 *)
  95.   aFNT10 *  = 44;  (* ESC(C Danish II char set or Typeface 10 *)
  96.  
  97. (*
  98.         Suggested typefaces are:
  99.  
  100.          0 - default typeface.
  101.          1 - Line Printer or equiv.
  102.          2 - Pica or equiv.
  103.          3 - Elite or equiv.
  104.          4 - Helvetica or equiv.
  105.          5 - Times Roman or equiv.
  106.          6 - Gothic or equiv.
  107.          7 - Script or equiv.
  108.          8 - Prestige or equiv.
  109.          9 - Caslon or equiv.
  110.         10 - Orator or equiv.
  111. *)
  112.  
  113.   aPROP2 *  = 45;  (* ESC[2p  proportional on        +++ *)
  114.   aPROP1 *  = 46;  (* ESC[1p  proportional off       +++ *)
  115.   aPROP0 *  = 47;  (* ESC[0p  proportional clear     +++ *)
  116.   aTSS *    = 48;  (* ESC[n E set proportional offset ISO *)
  117.   aJFY5 *   = 49;  (* ESC[5 F auto left justify      ISO *)
  118.   aJFY7 *   = 50;  (* ESC[7 F auto right justify     ISO *)
  119.   aJFY6 *   = 51;  (* ESC[6 F auto full justify      ISO *)
  120.   aJFY0 *   = 52;  (* ESC[0 F auto justify off       ISO *)
  121.   aJFY3 *   = 53;  (* ESC[3 F letter space (justify) ISO (special) *)
  122.   aJFY1 *   = 54;  (* ESC[1 F word fill(auto center) ISO (special) *)
  123.  
  124.   aVERP0 *  = 55;  (* ESC[0z  1/8" line spacing      +++ *)
  125.   aVERP1 *  = 56;  (* ESC[1z  1/6" line spacing      +++ *)
  126.   aSLPP *   = 57;  (* ESC[nt  set form length n      DEC *)
  127.   aPERF *   = 58;  (* ESC[nq  perf skip n (n>0)      +++ *)
  128.   aPERF0 *  = 59;  (* ESC[0q  perf skip off          +++ *)
  129.  
  130.   aLMS *    = 60;  (* ESC#9   Left margin set        +++ *)
  131.   aRMS *    = 61;  (* ESC#0   Right margin set       +++ *)
  132.   aTMS *    = 62;  (* ESC#8   Top margin set         +++ *)
  133.   aBMS *    = 63;  (* ESC#2   Bottom marg set        +++ *)
  134.   aSTBM *   = 64;  (* ESC[Pn1;Pn2r  T&B margins      DEC *)
  135.   aSLRM *   = 65;  (* ESC[Pn1;Pn2s  L&R margin       DEC *)
  136.   aCAM *    = 66;  (* ESC#3   Clear margins          +++ *)
  137.  
  138.   aHTS *    = 67;  (* ESCH    Set horiz tab          ISO *)
  139.   aVTS *    = 68;  (* ESCJ    Set vertical tabs      ISO *)
  140.   aTBC0 *   = 69;  (* ESC[0g  Clr horiz tab          ISO *)
  141.   aTBC3 *   = 70;  (* ESC[3g  Clear all h tab        ISO *)
  142.   aTBC1 *   = 71;  (* ESC[1g  Clr vertical tabs      ISO *)
  143.   aTBC4 *   = 72;  (* ESC[4g  Clr all v tabs         ISO *)
  144.   aTBCALL * = 73;  (* ESC#4   Clr all h & v tabs     +++ *)
  145.   aTBSALL * = 74;  (* ESC#5   Set default tabs       +++ *)
  146.   aEXTEND * = 75;  (* ESC[Pn"x extended commands     +++ *)
  147.  
  148.   aRAW *    = 76;      (* ESC[Pn"r     Next 'Pn' chars are raw +++ *)
  149.  
  150. TYPE
  151.  
  152.   IOPrtCmdReqPtr * = POINTER TO IOPrtCmdReq;
  153.   IOPrtCmdReq * = RECORD (e.IORequestBase)
  154.     message *    : e.Message;
  155.     device *     : e.DevicePtr; (* device node pointer  *)
  156.     unit *       : e.UnitPtr;   (* unit (driver private)*)
  157.     command *    : e.UWORD;     (* device command *)
  158.     flags *      : s.SET8;
  159.     error *      : SHORTINT;    (* error or warning num *)
  160.     prtCommand * : e.UWORD;     (* printer command *)
  161.     parm0 *      : e.UBYTE;     (* first command parameter *)
  162.     parm1 *      : e.UBYTE;     (* second command parameter *)
  163.     parm2 *      : e.UBYTE;     (* third command parameter *)
  164.     parm3 *      : e.UBYTE;     (* fourth command parameter *)
  165.   END; (* IOPrtCmdReq *)
  166.  
  167.   IODRPReqPtr * = POINTER TO IODRPReq;
  168.   IODRPReq * = RECORD (e.IORequestBase)
  169.     message *   : e.Message;
  170.     device *    : e.DevicePtr;   (* device node pointer  *)
  171.     unit *      : e.UnitPtr;     (* unit (driver private)*)
  172.     command *   : e.UWORD;       (* device command *)
  173.     flags *     : s.SET8;
  174.     error *     : SHORTINT;      (* error or warning num *)
  175.     rastPort *  : g.RastPortPtr; (* raster port *)
  176.     colorMap *  : g.ColorMapPtr; (* color map *)
  177.     modes *     : s.SET32;       (* graphics viewport modes *)
  178.     srcX *      : e.UWORD;       (* source x origin *)
  179.     srcY *      : e.UWORD;       (* source y origin *)
  180.     srcWidth *  : e.UWORD;       (* source x width *)
  181.     srcHeight * : e.UWORD;       (* source x height *)
  182.     destCols *  : LONGINT;       (* destination x width *)
  183.     destRows *  : LONGINT;       (* destination y height *)
  184.     special *   : s.SET16;       (* option flags *)
  185.   END; (* IODRPReq *)
  186.  
  187. CONST
  188.  
  189.   milCols *         = 0;        (* DestCols specified in 1/1000" *)
  190.   milRows *         = 1;        (* DestRows specified in 1/1000" *)
  191.   fullCols *        = 2;        (* make DestCols maximum possible *)
  192.   fullRows *        = 3;        (* make DestRows maximum possible *)
  193.   fracCols *        = 4;        (* DestCols is fraction of FULLCOLS *)
  194.   fracRows *        = 5;        (* DestRows is fraction of FULLROWS *)
  195.   center *          = 6;        (* center image on paper *)
  196.   aspect *          = 7;        (* ensure correct aspect ratio *)
  197.   density1 *        = {8};      (* lowest resolution (dpi) *)
  198.   density2 *        = {9};      (* next res *)
  199.   density3 *        = {8,9};    (* next res *)
  200.   density4 *        = {10};     (* next res *)
  201.   density5 *        = {8,10};   (* next res *)
  202.   density6 *        = {9,10};   (* next res *)
  203.   density7 *        = {8,9,10}; (* highest res *)
  204.   noFormFeed *      = 11;       (* don't eject paper on gfx prints *)
  205.   trustMe *         = 12;       (* don't reset on gfx prints *)
  206.  
  207. (*
  208.         Compute print size, set 'ioDestCols' and 'ioDestRows' in the calling
  209.         program's 'IODRPReq' structure and exit, DON'T PRINe.  This allows the
  210.         calling program to see what the final print size would be in printer
  211.         pixels.  Note that it modifies the 'ioDestCols' and 'ioDestRows'
  212.         fields of your 'IODRPReq' structure.  Also, set the print density and
  213.         update the 'MaxXDots', 'MaxYDots', 'XDotsInch', and 'YDotsInch' fields
  214.         of the 'PrinterExtendedData' structure.
  215. *)
  216.  
  217.   noPrint *           = 13;      (* see above *)
  218.  
  219.   noErr *             = 0;       (* clean exit, no errors *)
  220.   cancel *            = 1;       (* user cancelled print *)
  221.   notGraphics *       = 2;       (* printer cannot output graphics *)
  222.   invertHAM *         = 3;       (* OBSOLETE *)
  223.   badDimension *      = 4;       (* print dimensions illegal *)
  224.   dimensionOvflow *   = 5;       (* OBSOLETE *)
  225.   internalMemory *    = 6;       (* no memory for internal variables *)
  226.   bufferMemory *      = 7;       (* no memory for print buffer *)
  227. (*
  228.  
  229.         Note * : this is an internal error that can be returned from the render
  230.         function to the printer device.  It is NEVER returned to the user.
  231.         If the printer device sees this error it converts it 'PderrNOERR'
  232.         and exits gracefully.  Refer to the document on
  233.         'How to Write a Graphics Printer Driver' for more info.
  234. *)
  235.  
  236.   tookControl *       = 8;       (* Took control in case 0 of render *)
  237.  
  238. (* internal use *)
  239.   densityMask *     = {8..10};  (* masks out density values *)
  240.   dimensionsMask *  = { milCols .. fracRows, aspect };
  241.  
  242. (*
  243. **      $VER: prtg.h 1.12 (26.7.90)
  244. **
  245. **      printer.device structure definitions
  246. *)
  247.  
  248. CONST
  249.  
  250.   yellow *       = 0;               (* byte index for yellow *)
  251.   magenta *      = 1;               (* byte index for magenta *)
  252.   cyan *         = 2;               (* byte index for cyan *)
  253.   black *        = 3;               (* byte index for black *)
  254.   blue *         = yellow;          (* byte index for blue *)
  255.   green *        = magenta;         (* byte index for green *)
  256.   red *          = cyan;            (* byte index for red *)
  257.   white *        = black;           (* byte index for white *)
  258.  
  259. TYPE
  260.  
  261.   colorEntryPtr * = POINTER TO colorEntry;
  262.   colorEntry * = RECORD
  263.   (*colorLong *  : e.ULONG;            (* quick access to all of YMCB *)*)
  264.     colorByte *  : ARRAY 4 OF e.UBYTE; (* 1 entry for each of YMCB *)
  265.   (*colorSByte * : SHORTINT[4];        (* ditto (except signed) *)*)
  266.   END; (* colorEntry *)
  267.  
  268.   PrtInfoPtr * = POINTER TO PrtInfo;
  269.   PrtInfo * = RECORD
  270.     render        : PROCEDURE (): LONGINT; (* PRIVATE - DO NOT USE! *)
  271.     rp            : g.RastPortPtr; (* PRIVATE - DO NOT USE! *)
  272.     temprp        : g.RastPortPtr; (* PRIVATE - DO NOT USE! *)
  273.     rowBuf        : e.APTR;        (* PRIVATE - DO NOT USE! *)
  274.     hamBuf        : e.APTR;        (* PRIVATE - DO NOT USE! *)
  275.     colorMap      : colorEntryPtr; (* PRIVATE - DO NOT USE! *)
  276.     colorInt *    : colorEntryPtr; (* color intensities for entire row *)
  277.     hamInt        : colorEntryPtr; (* PRIVATE - DO NOT USE! *)
  278.     dest1Int      : colorEntryPtr; (* PRIVATE - DO NOT USE! *)
  279.     dest2Int      : colorEntryPtr; (* PRIVATE - DO NOT USE! *)
  280.     scaleX *      : e.APTR;        (* array of scale values for X *)
  281.     scaleXAlt     : e.APTR;        (* PRIVATE - DO NOT USE! *)
  282.     dmatrix *     : e.APTR;        (* pointer to dither matrix *)
  283.     topBuf        : e.APTR;        (* PRIVATE - DO NOT USE! *)
  284.     botBuf        : e.APTR;        (* PRIVATE - DO NOT USE! *)
  285.  
  286.     rowBufSize    : e.UWORD;       (* PRIVATE - DO NOT USE! *)
  287.     hamBufSize    : e.UWORD;       (* PRIVATE - DO NOT USE! *)
  288.     colorMapSize  : e.UWORD;       (* PRIVATE - DO NOT USE! *)
  289.     colorIntSize  : e.UWORD;       (* PRIVATE - DO NOT USE! *)
  290.     hamIntSize    : e.UWORD;       (* PRIVATE - DO NOT USE! *)
  291.     dest1IntSize  : e.UWORD;       (* PRIVATE - DO NOT USE! *)
  292.     dest2IntSize  : e.UWORD;       (* PRIVATE - DO NOT USE! *)
  293.     scaleXSize    : e.UWORD;       (* PRIVATE - DO NOT USE! *)
  294.     scaleXAltSize : e.UWORD;       (* PRIVATE - DO NOT USE! *)
  295.  
  296.     prefsFlags    : s.SET16;       (* PRIVATE - DO NOT USE! *)
  297.     special       : e.ULONG;       (* PRIVATE - DO NOT USE! *)
  298.     xstart        : e.UWORD;       (* PRIVATE - DO NOT USE! *)
  299.     ystart        : e.UWORD;       (* PRIVATE - DO NOT USE! *)
  300.     width *       : e.UWORD;       (* source width (in pixels) *)
  301.     height        : e.UWORD;       (* PRIVATE - DO NOT USE! *)
  302.     pc            : e.ULONG;       (* PRIVATE - DO NOT USE! *)
  303.     pr            : e.ULONG;       (* PRIVATE - DO NOT USE! *)
  304.     ymult         : e.UWORD;       (* PRIVATE - DO NOT USE! *)
  305.     ymod          : e.UWORD;       (* PRIVATE - DO NOT USE! *)
  306.     ety           : INTEGER;       (* PRIVATE - DO NOT USE! *)
  307.     xpos *        : e.UWORD;       (* offset to start printing picture *)
  308.     threshold *   : e.UWORD;       (* threshold value (from prefs) *)
  309.     tempwidth     : e.UWORD;       (* PRIVATE - DO NOT USE! *)
  310.     flags         : s.SET16;       (* PRIVATE - DO NOT USE! *)
  311.   END; (* PrtInfo *)
  312.  
  313. (*
  314. **      $VER: prtbase.h 1.10 (2.11.90)
  315. **
  316. **      printer.device base structure definitions
  317. *)
  318.  
  319. TYPE
  320.  
  321.   DeviceDataPtr * = POINTER TO DeviceData;
  322.   DeviceData * = RECORD (e.LibraryBase)
  323.     device *      : e.Library;      (* standard library node *)
  324.     segment *     : e.BPTR;         (* A0 when initialized *)
  325.     execBase *    : e.LibraryPtr;   (* A6 for exec *)
  326.     cmdVectors *  : e.APTR;         (* command table for device commands *)
  327.     cmdBytes *    : e.APTR;         (* bytes describing which command queue *)
  328.     numCommands * : e.UWORD;        (* the number of commands supported *)
  329.   END; (* DeviceData *)
  330.  
  331. CONST
  332.  
  333.   oldStkSize *    = 0800H;  (* stack size for child task (OBSOLETE) *)
  334.   stkSize *       = 1000H;  (* stack size for child task *)
  335.   bufSize *       = 256;    (* size of internal buffers for text i/o *)
  336.   safeSize *      = 128;    (* safety margin for text output buffer *)
  337.  
  338. TYPE
  339.  
  340.   PrinterExtendedDataPtr * = POINTER TO PrinterExtendedData;
  341.   PrinterExtendedData * = RECORD
  342.     printerName *  : e.LSTRPTR; (* printer name, null terminated *)
  343.     init *         : e.PROC;    (* called after LoadSeg *)
  344.     expunge *      : e.PROC;    (* called before UnLoadSeg *)
  345.     open *         : PROCEDURE () : LONGINT; (* called at OpenDevice *)
  346.     close *        : e.PROC;    (* called at CloseDevice *)
  347.     printerClass * : s.SET8;    (* printer class *)
  348.     colorClass *   : s.SET8;    (* color class *)
  349.     maxColumns *   : SHORTINT;  (* number of print columns available *)
  350.     numCharSets *  : SHORTINT;  (* number of character sets *)
  351.     numRows *      : e.UWORD;   (* number of 'pins' in print head *)
  352.     maxXDots *     : e.ULONG;   (* number of dots max in a raster dump *)
  353.     maxYDots *     : e.ULONG;   (* number of dots max in a raster dump *)
  354.     xDotsInch *    : e.UWORD;   (* horizontal dot density *)
  355.     yDotsInch *    : e.UWORD;   (* vertical dot density *)
  356.     commands *     : e.APTR;    (* printer text command table *)
  357.     doSpecial *    : PROCEDURE () : LONGINT; (* Special command handler *)
  358.     render *       : PROCEDURE () : LONGINT; (* raster render function *)
  359.     timeoutSecs *  : LONGINT;   (* good write timeout *)
  360.     (* the following only exists if the segment version is >= 33 *)
  361.     eight8BitChars * : e.APTR;  (* conv. strings for the extended font *)
  362.     printMode *    : LONGINT;   (* set if text printed, otherwise 0 *)
  363.     (* the following only exists if the segment version is >= 34 *)
  364.     (* ptr to conversion function for all chars *)
  365.     convFunc *     : PROCEDURE () : LONGINT;
  366.   END; (* PrinterExtendedData *)
  367.  
  368.   PrinterSegmentPtr * = POINTER TO PrinterSegment;
  369.   PrinterSegment * = RECORD
  370.     nextSegment * : e.BPTR;   (* (actually a BPTR) *)
  371.     runAlert *    : e.ULONG;  (* MOVEQ #0,D0 * : RTS *)
  372.     version *     : e.UWORD;  (* segment version *)
  373.     revision *    : e.UWORD;  (* segment revision *)
  374.     ped *         : PrinterExtendedData;   (* printer extended data *)
  375.   END; (* PrinterSegment *)
  376.  
  377.   PrinterDataPtr * = POINTER TO PrinterData;
  378.   PrinterData * = RECORD (e.LibraryBase)
  379.     device *       : DeviceData;
  380.     unit *         : e.MsgPort;   (* the one and only unit *)
  381.     printerSegment * : e.BPTR;    (* the printer specific segment *)
  382.     printerType *  : e.UWORD;     (* the segment printer type *)
  383.                                   (* the segment data structure *)
  384.     segmentData *  : PrinterSegmentPtr;
  385.     printBuf *     : e.APTR;      (* the raster print buffer *)
  386.     pWrite *       : PROCEDURE () : LONGINT; (* the write function *)
  387.     pBothReady *   : PROCEDURE () : LONGINT; (* write function's done *)
  388.     p0 *           : par.IOExtPar; (* port I/O request 0 *)
  389.     p0pad          : ARRAY (SIZE (ser.IOExtSer) - SIZE (par.IOExtPar)) OF SYS.BYTE;
  390.     p1 *           : par.IOExtPar; (*   and 1 for double buffering *)
  391.     p1pad          : ARRAY (SIZE (ser.IOExtSer) - SIZE (par.IOExtPar)) OF SYS.BYTE;
  392.     tior *         : t.TimeRequest;  (* timer I/O request *)
  393.     iorPort *      : e.MsgPort;      (* and message reply port *)
  394.     tc *           : e.Task;         (* write task *)
  395.     oldStk *       : ARRAY oldStkSize OF e.BYTE;
  396.                                      (* and stack space (OBSOLETE) *)
  397.     flags *        : s.SET8;         (* device flags *)
  398.     pad *          : e.UBYTE;        (* padding *)
  399.     preferences *  : i.Preferences;  (* the latest preferences *)
  400.     pWaitEnabled * : SHORTINT;       (* wait function switch *)
  401.     (* new fields for V2.0 *)
  402.     flags1 *       : s.SET8;         (* padding *)
  403.     stk *          : ARRAY stkSize OF SYS.BYTE;
  404.                                      (* stack space *)
  405.   END; (* PrinterData *)
  406.  
  407.   PrinterDataSerPtr * = POINTER TO PrinterDataSer;
  408.   PrinterDataSer * = RECORD (e.LibraryBase)
  409.     device *       : DeviceData;
  410.     unit *         : e.MsgPort;     (* the one and only unit *)
  411.     printerSegment * : e.BPTR;      (* the printer specific segment *)
  412.     printerType *  : e.UWORD;       (* the segment printer type *)
  413.                                     (* the segment data structure *)
  414.     segmentData *  : PrinterSegmentPtr;
  415.     printBuf *     : e.APTR;        (* the raster print buffer *)
  416.     pWrite *       : PROCEDURE () : LONGINT; (* the write function *)
  417.     pBothReady *   : PROCEDURE () : LONGINT; (* write function's done *)
  418.     s0 *           : ser.IOExtSer;  (* port I/O request 0 *)
  419.     s1 *           : ser.IOExtSer;  (*   and 1 for double buffering *)
  420.     tior *         : t.TimeRequest; (* timer I/O request *)
  421.     iorPort *      : e.MsgPort;     (* and message reply port *)
  422.     tc *           : e.Task;        (* write task *)
  423.     oldStk *       : ARRAY oldStkSize OF e.BYTE;
  424.                                     (* and stack space (OBSOLETE) *)
  425.     flags *        : s.SET8;        (* device flags *)
  426.     pad *          : e.UBYTE;       (* padding *)
  427.     preferences *  : i.Preferences; (* the latest preferences *)
  428.     pWaitEnabled * : SHORTINT;      (* wait function switch *)
  429.     (* new fields for V2.0 *)
  430.     flags1 *       : s.SET8;        (* padding *)
  431.     stk *          : ARRAY stkSize OF SYS.BYTE;
  432.                                     (* stack space *)
  433.   END; (* PrinterDataSer *)
  434.  
  435. CONST
  436.  
  437. (* Printer Class *)
  438.   gfx *         = 0;      (* graphics (bit position) *)
  439.   color *       = 1;      (* color (bit position) *)
  440.  
  441.   bwAlpha *     = {};           (* black&white alphanumerics *)
  442.   bwGfx *       = {gfx};        (* black&white graphics *)
  443.   colorAlpha *  = {color};      (* color alphanumerics *)
  444.   colorGfx *    = {gfx, color}; (* color graphics *)
  445.  
  446. (* Color Class *)
  447.   bw *          = {0};       (* black&white only *)
  448.   ymc *         = {1};       (* yellow/magenta/cyan only *)
  449.   ymcBW *       = {0, 1};    (* yellow/magenta/cyan or black&white *)
  450.   ymcb *        = 2;         (* yellow/magenta/cyan/black *)
  451.   fourcolor *   = 2;         (* a flag for YMCB and BGRW *)
  452.   additive *    = 3;         (* not ymcb but blue/green/red/white *)
  453.   wb *          = {0, 3};    (* black&white only, 0 * == BLACK *)
  454.   bgr *         = {1, 3};    (* blue/green/red *)
  455.   bgrWB *       = {0, 1, 3}; (* blue/green/red or black&white *)
  456.   bgrw *        = {2, 3};    (* blue/green/red/white *)
  457. (*
  458.         The picture must be scanned once for each color component, as the
  459.         printer can only define one color at a time.  ie. If 'PccYMC' then
  460.         first pass sends all 'Y' info to printer, second pass sends all 'M'
  461.         info, and third pass sends all C info to printer.  The CalComp
  462.         PlotMaster is an example of this type of printer.
  463. *)
  464.   multiPass *  = 4;    (* see explanation above *)
  465.  
  466. END Printer.
  467.